home *** CD-ROM | disk | FTP | other *** search
/ 8bitfiles.net/archives / archives.tar / archives / compuserve-file-archive / 04 geoProgramming / HEXCLC.SDA / DISPLAY (.txt) < prev    next >
Encoding:
GEOS ConVerT  |  2019-04-13  |  4.3 KB  |  246 lines

  1. !    DISPLAY
  2. SEQ formatted GEOS file V1.0
  3. Olivetti PR2300
  4. OP V2.0 or higher
  5. BLASTER'S CONVERTER V2.5
  6. COPE SOURCE V1.0
  7. DL870517
  8. COPE EDITOR V1.0
  9. ; Routines to print the values
  10. Display
  11.  ldx DISLEN
  12.  beq Exit
  13.  stx TempDislen
  14.  lda #<Yvalue
  15.  sta YPos
  16.  lda #<Xvalue
  17.  sta XPos
  18.  lda #>Xvalue
  19.  sta XPos+1
  20.  lda #32
  21.  jmp Loopz
  22.  dec TempDislen
  23.  ldx TempDislen
  24.  lda DXSBUF,X
  25. Loopz
  26.  jsr GetCharWidth
  27.  sta curCharWidth
  28.  lda XPos
  29.  sbc curCharWidth
  30.  sta XPos
  31.  sta AP1
  32.  dec AP1
  33.  sta R11
  34.  lda XPos+1
  35.  sta R11+1
  36.  lda YPos
  37.  sta R1+1
  38.  jsr PutChar
  39.  ldx TempDislen
  40.  bne Loop
  41.  jsr i_Rectangle
  42.  .Byte Yvalue-6
  43.  .Byte Yvalue+2
  44.  .Word Xvalue-85
  45.  .Word Xvalue
  46. XPos .Byte 0,0
  47. YPos .Byte 0
  48. TempDislen .Byte 0
  49. curCharWidth .Byte 0
  50. ;---------
  51. keypress .Byte 0
  52. IconCall
  53. lda R0
  54.  sta keypress
  55. IconCall2
  56.  lda keypress
  57.  cmp #16
  58.  bcs Skip1
  59. ldx Mode
  60.  bmi binarylp
  61.  bne hexlp
  62. declp
  63.  cmp #10
  64.  bcs notdecchar
  65.  jsr Keyin
  66.  jsr DECBIN
  67.  jsr BINDEC
  68.  jsr Display
  69. notdecchar
  70. Skip1
  71. binarylp
  72. cmp #2
  73.  bcs notbinchar
  74.  jsr Keyin
  75.  jsr ST2BIN
  76.  jsr BIN2ST
  77.  jsr Display
  78. notbinchar
  79. hexlp
  80.  jsr Keyin
  81.  Jsr HEXBIN
  82.  jsr BINHEX
  83.  jsr Display
  84. Keyin
  85.  ldx Mode
  86.  lda Keyinlen
  87.  cmp charinmode,x
  88.  bcs nomorechar
  89.  ldx Keyinlen
  90.  adc #48
  91.  cmp #58
  92.  bcc ok
  93. adc #6
  94.  sta KINBUF,X
  95.  inc Keyinlen
  96. nomorechar
  97. charinmode .Byte 16,5,4 ; mode 0 is binary, mode 1 is decimal,
  98. ; mode 2 is hex
  99. Mode .Byte 1
  100. TextStrings
  101. jsr $C1AE ; iputstring
  102. .Word Icon_X_Pos*8+8
  103. .Byte Icon_Y_Pos+10
  104. .Byte '7',20,Icon_X_Pos*8+8+3*8,0
  105. .Byte '8',20,Icon_X_Pos*8+8+6*8,0
  106. .Byte '9',20,Icon_X_Pos*8+8+9*8,0
  107. .Byte 'F',20,Icon_X_Pos*8+8+12*8,0
  108. .Byte '/',0
  109. jsr $C1AE ; iputstring
  110. .Word Icon_X_Pos*8+8
  111. .Byte Icon_Y_Pos+10+1*16
  112. .Byte '4',20,Icon_X_Pos*8+8+3*8,0
  113. .Byte '5',20,Icon_X_Pos*8+8+6*8,0
  114. .Byte '6',20,Icon_X_Pos*8+8+9*8,0
  115. .Byte 'E',20,Icon_X_Pos*8+8+12*8,0
  116. .Byte '*',0
  117. jsr $C1AE ; iputstring
  118. .Word Icon_X_Pos*8+8
  119. .Byte Icon_Y_Pos+10+2*16
  120. .Byte '1',20,Icon_X_Pos*8+8+3*8,0
  121. .Byte '2',20,Icon_X_Pos*8+8+6*8,0
  122. .Byte '3',20,Icon_X_Pos*8+8+9*8,0
  123. .Byte 'D',20,Icon_X_Pos*8+8+12*8,0
  124. .Byte '-',0
  125. jsr $C1AE ; iputstring
  126. .Word Icon_X_Pos*8+8
  127. .Byte Icon_Y_Pos+10+3*16
  128. .Byte '0',20,Icon_X_Pos*8+8+3*8,0
  129. .Byte 'A',20,Icon_X_Pos*8+8+6*8,0
  130. .Byte 'B',20,Icon_X_Pos*8+8+9*8,0
  131. .Byte 'C',20,Icon_X_Pos*8+8+12*8,0
  132. .Byte '+',0
  133. jsr $C1AE ; iputstring
  134. .Word Icon_X_Pos*8+2
  135. .Byte Icon_Y_Pos+09+4*16
  136. .Byte 'HEX',20,Icon_X_Pos*8+4+3*8,0
  137. .Byte 'DEC',20,Icon_X_Pos*8+4+6*8,0
  138. .Byte 'BIN',20,Icon_X_Pos*8+8+12*8,0
  139. .Byte '=',0
  140. jsr $C1AE ; iputstring
  141. .Word Icon_X_Pos*8+8
  142. .Byte Icon_Y_Pos+10+6*16
  143. .Byte 'C',20,Icon_X_Pos*8+4+3*8,0
  144. .Byte 'CA',20,Icon_X_Pos*8+4+6*8,0
  145. .Byte 'Del',20,Icon_X_Pos*8+3+9*8,0
  146. .Byte 'Exit',0
  147. jsr $C1AE ; iputstring
  148. .Word Icon_X_Pos*8+1
  149. .Byte Icon_Y_Pos+10+5*16
  150. .Byte 'AND',20,Icon_X_Pos*8+2+3*8,0
  151. .Byte 'EOR',20,Icon_X_Pos*8+1+6*8,0
  152. .Byte 'ORA',0
  153. ;*****
  154. ClearAll
  155.  lda #0
  156.  sta STKPTR
  157. Clear
  158.  lda #0
  159.  sta RESULT
  160.  STA RESULT+1
  161.  STA Keyinlen
  162.  lda #32
  163.  sta CARRY
  164.  lda #48
  165.  sta DXSBUF
  166.  lda #1
  167.  sta DISLEN
  168.  jsr Display
  169.  lda #0
  170.  sta DISLEN
  171. ;--------
  172. SWITCHMODE
  173. lda R0
  174.  sta keypress
  175. SWITCHMODE2
  176.  lda keypress
  177.  SBC #25
  178.  STA Mode
  179.  SWCHMODE2
  180.  LDA RESULT
  181.  ora RESULT+1
  182.  BNE NOZERO
  183.  JSR Clear
  184.  JSR PrintMode
  185. NOZERO
  186.  LDA RESULT
  187.  STA VALUE
  188.  LDA RESULT+1
  189.  STA VALUE+1
  190.  JSR PrintMode
  191.  JSR DUPLICATE
  192. PrintMode
  193.  ldx Mode
  194.  BMI BINSWITCH
  195.  BNE HEXSWITCH
  196.  DECSWITCH
  197.  jsr BINDEC
  198.  JSR i_PutString
  199.  .Word Xvalue+10
  200.  .Byte Yvalue
  201.  .Byte ' DEC ',0
  202. HEXSWITCH
  203.  jsr BINHEX
  204.  JSR i_PutString
  205.  .Word Xvalue+10
  206.  .Byte Yvalue
  207.  .Byte ' HEX ',0
  208.  RTS 
  209.  BINSWITCH
  210.  jsr BIN2ST
  211.  JSR i_PutString
  212.  .Word Xvalue+10
  213.  .Byte Yvalue
  214.  .Byte ' BIN ',0
  215. DUPLICATE
  216.  ldx #16
  217.  DUPLOOP
  218.  lda DISLEN,X
  219.  sta Keyinlen,X
  220.  bpl DUPLOOP
  221.  JSR Display
  222.  RTS 
  223. ;========
  224. Delete
  225.  ldx Keyinlen
  226.  beq EXITDEL
  227.  bne DELCONT
  228.  stx Keyinlen
  229.  jsr Clear
  230. DELCONT
  231.  stx Keyinlen
  232.  ldx Mode
  233.  bmi BINDEL
  234.  bne HEXDEL
  235.  DECDEL
  236.  JSR DECBIN
  237.  JMP ENDDEL
  238. BINDEL
  239.  jsr ST2BIN
  240.  jmp ENDDEL
  241. HEXDEL
  242.  jsr HEXBIN
  243. ENDDEL
  244.  jsr SWCHMODE2
  245. EXITDEL
  246.